"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Global = void 0;
const mongodb_1 = require("mongodb");
const Config_1 = require("./Config");
class Global {
    static async init(logger) {
        logger === null || logger === void 0 ? void 0 : logger.log(`Start connecting db...`);
        const client = await new mongodb_1.MongoClient(Config_1.Config.mongoDb).connect();
        logger === null || logger === void 0 ? void 0 : logger.log(`Db connected successfully...`);
        this.db = client.db();
    }
    static collection(col) {
        return this.db.collection(col);
    }
}
exports.Global = Global;
